from django.db import models
from django.contrib.auth.models import AbstractUser
from shopapp.models import Goods


class User(AbstractUser):
    phone = models.CharField(max_length=11)

    class Meta:
        db_table = "users"


class GoodsRecord(models.Model):
    user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
    goods = models.ForeignKey(Goods, on_delete=models.SET_NULL, null=True)
    created = models.DateTimeField(auto_now_add=True)

    class Meta:
        db_table = "goods_record"
